<template>
  <div style="text-align: center">
    <el-avatar :size="100" :src="circleUrl" style=""><el-icon :size="50"><User /></el-icon></el-avatar>
    <p class="information">用户:{{showMsg.user_name}}</p>
    <p class="information" v-if="showMsg.role == 1">开发者</p>
    <p class="information" v-else>管理员</p>
  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "index",
  data(){
    return{
      showMsg :{
        user_name:null,
        role: null
      }
    }
  },
  props:{
    selfMsg: {
      type : Object
    }
  },
  created() {
    this.findUser()
  }
  ,
  methods:{

    findUser(){
      console.log("生")
      axios({
        method:"GET",
        url:"http://39.101.199.5:8888/SuJiWords/user/findUser/"+this.selfMsg
      }).then(response =>(this.showMsg = response.data.data))
    }
  }

}
</script>

<style scoped>
  .information{
    font-weight: bold;
    font-size: xx-large;
    color: white;
  }
</style>